//
//  SampuxToolBarButton.m
//  Sampux
//
//  Created by rzm on 16/7/15.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SampuxToolBarButton.h"

@implementation SampuxToolBarButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //        self.backgroundColor = AWBackgroundColor;
        //        self.titleLabel.font = THFont(12);
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [self setTitleColor:THWhiteAlplaColor(0.64) forState:UIControlStateNormal];
//        self.changedUnitState = NO;
    }
    return self;
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat w = self.width;
    CGFloat h = 20.;
    CGFloat y = self.height - h - 2;
    return CGRectMake(0, y, w, h);
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat w = 20.;
    CGFloat h = w;
    CGFloat x = (self.width - w) / 2;
    return CGRectMake(x, 6, w, h);
}
@end
